package com.yuncommunity.cloudlab

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
class AdminConfig : WebMvcConfigurer {
    @Autowired
    lateinit var adminInterceptor: AdminInterceptor

    override fun addInterceptors(registry: InterceptorRegistry) {
        super.addInterceptors(registry)

        registry.addInterceptor(adminInterceptor)
                .addPathPatterns("/admin/api/**")
                .excludePathPatterns("/admin/api/user/login",
                        "/admin/api/perm/user/menu",
                        "/admin/api/user/imageCode")
    }
}